#ifndef GIFAPPLICATIONEXTENSION_H
#define GIFAPPLICATIONEXTENSION_H

#include "gifextension.h"
#include "winggif.h"

namespace WingGif {

class WINGEXPORT GifApplicationExtension : public GifExtension {
  Q_OBJECT
  Q_PROPERTY(int blockSize READ blockSize)
  Q_PROPERTY(QString applicationIdentifier READ applicationIdentifier)
  Q_PROPERTY(QByteArray authenticationCode READ authenticationCode)
  Q_PROPERTY(QByteArray data READ data)

public:
  int blockSize();
  QString applicationIdentifier();
  QByteArray authenticationCode();
  QByteArray data();

  bool read(QIODevice *stream,
            QList<GifExtension *> controlExtensions) override;

  GifBlockKind kind() override;

  GifApplicationExtension(QObject *parent = nullptr);

  bool isNetscapeExtension();
  ushort getRepeatCount();

private:
  int _blockSize;
  QString _applicationIdentifier;
  QByteArray _authenticationCode;
  QByteArray _data;
};

} // namespace WingGif

#endif // GIFAPPLICATIONEXTENSION_H
